-- card: 29637 from stack: in.2r -- bmap block id: 0 -- flags: 0000 -- background id: 2612 -- name: DeleteFile2 -- part 1 (button) -- low flags: 00 -- high flags: A003 -- rect: left=82 top=302 right=324 bottom=182 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Install ----- HyperTalk script ----- on mouseUp -- --Original script by Steve Drazga, AnalytX --XFCNs used: none --XCMDs used: none --HANDLERS used: none --FUNCTIONS used: installRes -- if the optionkey is down then pass mouseup put installres(XCMD,field "name") into it put installres(DITL,field "name") into it put installres(ALRT,field "name") into it end mouseup -- part 2 (button) -- low flags: 00 -- high flags: A004 -- rect: left=252 top=27 right=52 bottom=351 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: try it ----- HyperTalk script ----- on mouseUp if the optionkey is down then edit script of me set cursor to 4 DeleteFile2 end mouseUp -- part contents for background part 2 ----- text ----- DeleteFile2 -- part contents for background part 3 ----- text ----- The DeleteFile XCMD by David Conger is public domain software and may be freely distributed (with this documentation). No Finder replacement stack is complete without one! When invoked, DeleteFile presents the user with a stanard Get File dialog box. The type of files displayed by the dialog depend on the parameters passed to DeleteFile. Once a file has been chosen, the user is presented with an alert to confirm the choice to delete the file. If the user clicks "OK" the file is deleted. Bug reports, comments and requests should be directed to DCONGER via GEnie mail. When using ResEdit or another resource mover to put DeleteFile into your own stacks, be sure to move its associated ALRT and DITL resources. They are numbered 25057 and 23580 respectively and are both named "DeleteFile." -- part contents for background part 10 ----- text ----- Syntax: DeleteFile2 [""] [,""] [,""] [,""] DeleteFile can be passed up to four optional parameters of file types (file types are four letter designators of, you guessed it, the file's type. e. g. "STAK" for stacks, "APPL" for applications, "TEXT" for text files, "PNTG" for paint files, and so on.) If DeleteFile is called without parameters, the Get File dialog will present all types of files, including invisible files (such as the Desktop file). Specifying file types in the parameters will limit the files displayed to the given types. If more than four parameters are supplied only the first four will be used. File types must be enclosed in quotes and must by separated by commas if more than one parameter is used. Errors resulting from DeleteFile are reported in the global variable "the result." Stack developers will not generally need to worry about this as the most common errors (file in use, file locked, disk locked) are handled by DeleteFile, which presents the user with an alert explaining what happened. If no file was selected or if the user decided not to delete the selected file, this information is also returned in "the result." These are the error messages which DeleteFile can return: No file was selected. File deletion canceled by user. OSErr: Bad file name OSErr: External file system OSErr: File busy OSErr: File locked OSErr: File not found OSErr: I/O error OSErr: No such volume OSErr: Software volume lock OSErr: Hardware volume lock Once again, DeleteFile handles the errors that are most likely to occur, so the developer will not generally have to worry about "the result." -- part contents for background part 13 ----- text ----- 21